const Koa=require('koa2');
const app=new Koa();


app.use(async (ctx,next)=>{
   console.log('M1 start');
   await next();
   console.log('M1 end.');
});

app.use(async (ctx,next)=>{
   console.log('M2 start');
   await next();
   console.log('M2 end.');
});


app.use(async (ctx,next)=>{
    ctx.body=new Date().toLocaleString();
});

app.listen(3030,()=>{
    console.log(`\n\nKoa2 port:3030 ${new Date().toLocaleString()}`);
});